//
//  MyServiceAnswersTableViewCell.m
//  MyProject
//
//  Created by jiaming yan on 2018/3/29.
//  Copyright © 2018年 yanjiaming. All rights reserved.
//

#import "MyServiceAnswersTableViewCell.h"
#import "AnswersListModel.h"
@implementation MyServiceAnswersTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
-(void)setContentArr:(NSArray *)contentArr{
    _contentArr = contentArr;
    for (UIView *aView in self.backView.subviews) {
        [aView removeFromSuperview];
    }
    for (NSInteger i = 0; i<contentArr.count; i++) {
        AnswersListModel *model = contentArr[i];
        UILabel *nameLabel =  [CommonUtils createLabelWithText:model.skillName frame:CGRectMake(15, 22+i*35, 100, 17)];
        nameLabel.font = k14Font;
        nameLabel.textColor = UIColorFromRGB(0X383F42);
        [self.backView addSubview:nameLabel];

        UILabel *priceLabel =  [CommonUtils createLabelWithText:[NSString stringWithFormat:@"¥%.2f",model.price] frame:CGRectMake(kScreenWidth - 45 - 100, 22+i*35, 100, 17)];
        priceLabel.font = k14Font;
        priceLabel.textAlignment = NSTextAlignmentRight;
        priceLabel.textColor = UIColorFromRGB(0X7ECCD8);
        [self.backView addSubview:priceLabel];
    }
    self.contentHeight.constant = 44 +35*_contentArr.count - 24;
    if (contentArr.count == 0) {
        self.contentHeight.constant = 0;
    }
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
